<template>
	<view>
		<up-textarea v-model="elog" placeholder="请输入您的宝贵意见~" height="250rpx" auto-height></up-textarea>
		<view class="my-log-btn">
			<up-button type="error" shape="circle" text="提交" @click="onSubmit"></up-button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import mineApi from '../../../api/mine';
	const elog = ref("")

	const userInfo = uni.getStorageSync("user");
	const user = JSON.parse(userInfo);
	const onSubmit = async () => {
		let reqObj = {
			m: user.Account,
			elog: elog.value,
			tpurl: null,
			avr: "",
			vr: "",
			elx: "1"
		};
		const res = await mineApi.sendErrlog(reqObj);
		console.log(res);
		uni.showToast({
			icon: 'success',
			title: "提交成功！"
		});
		elog.value = "";
	}
</script>

<style lang="scss" scoped>
	.my-log-btn {
		padding: 40rpx 20%;
	}
</style>